package com.rfs.design.templatemethod;

import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Map;

public class Db {
    private static Map<Long, BigDecimal> items=new HashMap<>();
    static {
        items.put(1L,new BigDecimal("10"));
        items.put(2L,new BigDecimal("20"));
    }
    public static BigDecimal getItemPrice(long id){
        return items.get(id);
    }
    public static CartTypeEnum getUserCategory(long userId){
        if (userId==1L){return CartTypeEnum.NORMAL;}
        if (userId==2L){return CartTypeEnum.VIP;}
        if (userId==3L){return CartTypeEnum.INTERNAL;}
        return CartTypeEnum.NORMAL;
    }
    public static int getUserCouponPercent(long userId){
        return 90;
    }
}
